This page last changed on Feb 14, 2007 by aaime.

In this document, I outline the procedure which I used to define custom parameters for a Lambert Conformal conic (2SP) projection in Geoserver.
As in the PostGis example, my projection has the following parameters:

Projection parameters (as reported in QGis)
PROJCS[ "unnamed ",GEOGCS[ "WGS 84 ",DATUM[ "WGS_1984 ",
SPHEROID[ "WGS 84 ",6378137,298.2572235629972,AUTHORITY[ "EPSG ", "7030 "]],AUTHORITY[ "EPSG ", "6326 "]],
PRIMEM[ "Greenwich ",0],UNIT[ "degree (supplier to define representation) ",0.01745329251994328],AUTHORITY[ "EPSG ", "4326 "]],
PROJECTION[ "Lambert_Conformal_Conic_2SP "],
PARAMETER[ "standard_parallel_1 ",33.00000000000004],
PARAMETER[ "standard_parallel_2 ",45.00000000000004],
PARAMETER[ "latitude_of_origin ",40.00333786010746],
PARAMETER[ "central_meridian ",-97.0000000000001],
PARAMETER[ "false_easting ",0],
PARAMETER[ "false_northing ",0],UNIT[ "metre ",1,AUTHORITY[ "EPSG ", "9001 "]]]

NOTE: As of now, there seem to be 2 different ways for defining a custom projection in Geoserver, depending on which release you use:

  1. For the main release (currently 1.3.0), the WKT of the custom projection needs to be inserted in the epsg.properties file.
  2. For the WCS experiment release, the custom projection needs to be defined in the EPSG.sql file.

1. Main Geoserver release 

  1. Change into your geoserver/WEB-INF/lib directory
  2. Uncompress the gt2-epsg.jar file:
    jar xvf gt2-epsg.jar

     
     
     
     

  3. Open the org/geotools/referencing/crs/epsg.properties file with a text editor.
  4. Insert the WKT (well known text) for the projection:
    41111=PROJCS["WRF_Lambert_Conformal_Conic 2", GEOGCS["GCS_North_American_1983", DATUM["D_WGS_1984", SPHEROID["WGS_1984", 6378137.0, 298.257223563]], PRIMEM["Greenwich", 0.0], UNIT["degree", 0.017453292519943295], AXIS["Lon", EAST], AXIS["Lat", NORTH]], PROJECTION["Lambert_Conformal_Conic", AUTHORITY["ESRI","Lambert_Conformal_Conic"]], PARAMETER["central_meridian", -97.0], PARAMETER["latitude_of_origin", 40.0], PARAMETER["standard_parallel_1", 33.0], PARAMETER["scale_factor", 1.0], PARAMETER["false_easting", 0.0], PARAMETER["false_northing", 0.0], PARAMETER["standard_parallel_2", 60.0], UNIT["m", 1.0], AXIS["x", EAST], AXIS["y", NORTH], AUTHORITY["EPSG","41111"]]

     
     
     
    Here 41111 is the EPSG code I assigned to my projection. If I remember correctly, users can use codes higher than 32760 to define their own projections.

  5. Save the file and exit.
  6. Compress the gt2-epsg.jar file:
    jar -Mcvf gt2-epsg.jar META-INF org

     
     
     

  7. Restart Geoserver.

If the WKT was parsed correctly, you should see the newly-defined projection by going to http://localhost:8080/geoserver/srsHelp.do.
(Similar to the picture at the bottom of this page). If the projection wasn't listed, examine the console output for any errors related to parsing
the WKT for your projection (the first time I insterted the WKT I had an extra comma):

tried to parse projection EPSG:41111 but couldnt!

It is possible that you might have to remove the cached copy of the EPSG database, so that can be recreated. On my Linux machine, it resides in my /tmp directory:

rm -rf /tmp/Geotools/Databases/HSQL

projection.png (image/png)
Document generated by Confluence on Jan 16, 2008 23:27